import type { RouteRecordRaw, RouteMeta } from "vue-router";

enum RoleEnum {
  SUPER = "super",
  TEST = "test"
}
import { DefineComponent, defineComponent } from "vue";

export interface MenuTag {
  type?: "primary" | "error" | "warn" | "success";
  content?: string;
  dot: boolean;
}

export interface Menu {
  path: string;
  name: string;
  icon: string;
  paramPath?: string;
  disabled?: boolean;
  children?: Menu[];
  orderNo?: number;
  roles?: RoleEnum[];
  meta?: Partial<RouteMeta>;
  tag?: MenuTag;
  hideMenu?: boolean;
}

export type Component<T = any> =
  | ReturnType<typeof defineComponent>
  | (() => Promise<typeof import("*.vue")>)
  | (() => Promise<T>);
export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, "meta"> {
  name: string;
  meta: RouteMeta;
  compnent?: Component | string;
  components?: Component;
  children?: AppRouteRecordRaw[];
  props?: Recordable;
  fullPath?: string;
}

export type AppRouteModule = AppRouteRecordRaw